﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using System.ComponentModel;

namespace JWUX.Supermarket.Model
{
    public enum UserGroup
    {
        ProduceOperator = 1,
        SupermarketOperator = 2,
        Administrator = 4
    }

    /// <summary>
    /// 用户实例
    /// </summary>
    [DataContract]
    public class UserInfo : IJsonSerializable
    {
        #region 属性

        [DataMember(Order = 1)]
        public int? Id
        {
            get;
            set;
        }

        [DataMember(Order = 2)]
        public string NTID
        {
            get;
            set;
        }

        [DataMember(Order = 3)]
        public string EmployeeId
        {
            get;
            set;
        }

        public string Password
        {
            get;
            set;
        }

        [DataMember(Order = 4)]
        public string FullName
        {
            get;
            set;
        }

        [DataMember(Order = 5)]
        public UserGroup Group
        {
            get;
            set;
        }

        public DateTime? CreatedOn
        {
            get;
            set;
        }

        public int? CreatedBy
        {
            get;
            set;
        }

        [DefaultValue(true)]
        public bool IsAvailable
        {
            get;
            set;
        }

        #endregion

        #region 构造和方法

        public UserInfo()
        {
        }

        #endregion
    }
}
